package org.dei.perla.rockfall.gui.queryforge;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

class ThresholdStatusPanel extends JPanel implements ParameterConfigurationManipulator{
	
	private GainsStatusGeophoneXPanel gsxPanel;
	private GainsStatusGeophoneYPanel gsyPanel;
	private GainsStatusGeophoneZPanel gszPanel;
	private DSPicParameters parameters;

public ThresholdStatusPanel() {
		super();
		BoxLayout layout = new BoxLayout(this, BoxLayout.Y_AXIS);
		this.setLayout(layout);
		gsxPanel = new GainsStatusGeophoneXPanel("ThupX");
		gsyPanel = new GainsStatusGeophoneYPanel("ThupY");
		gszPanel = new GainsStatusGeophoneZPanel("ThupZ");
		this.add(gsxPanel);
		this.add(gsyPanel);
		this.add(gszPanel);
	}

public ThresholdStatusPanel(DSPicParameters parameters) {
	this();
	this.parameters = parameters;
}

public void updateConfiguration() {
	this.gsxPanel.setStatus(this.parameters.getThupX());
	this.gsyPanel.setStatus(this.parameters.getThupY());
	this.gsyPanel.setStatus(this.parameters.getThupZ());
}

@Override
public void readConfiguration() throws IllegaParamValueException {
	this.parameters.setThupX(gsxPanel.getStatus());
	this.parameters.setThupY(gsyPanel.getStatus());
	this.parameters.setThupZ(gszPanel.getStatus());	
}

}
